<template>
  <div class="content-list">

    <slot name="title">
      <div class="content-title">
        <div class="title-text">{{ title }}</div>
        <div class="title-more" @click="emits('update:modelValue', index || 0)">
          <span>更多</span> <van-icon name="arrow" color="#999" />
        </div>
      </div>
    </slot>

    <div class="content-main">
      <slot></slot>
    </div>
  </div>
</template>

<script setup lang="ts">

const emits = defineEmits<{
  (e: 'update:modelValue', v: number): void
}>()

defineProps<{
  title: string,
  index?: number
}>()




</script>

<style scoped lang="less">
.content-list {
  font-size: 16px;
  padding-top: 20px;
  padding-left: 10px;

  .content-title {
    padding-left: 20px;
    padding-right: 10px;
    display: flex;
    font-weight: 700;
    justify-content: space-between;

    .title-more {
      font-size: 14px;
      color: #666;
    }
  }
}
</style>